import ajax from '@/utils/HttpUtil'
import {baseUrl as API_HOST} from '/env'
/**
 *   api
 *  @module code/api/reportImageGroup
 *  @author coder
 */

/**
 * 删除或批量删除
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/imagegroup/delete'
 */
export const POST_IMAGEGROUP_DELETE = API_HOST + '/report/imagegroup/delete'

/**
 * 删除或批量删除
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function postImagegroupDelete(data, options) {
  return ajax({
    method: 'post',
    data: data,
    url: POST_IMAGEGROUP_DELETE,
    ...options
  })
}

/**
 * 详情
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/imagegroup/info/:id'
 */
export const GET_IMAGEGROUP_INFO_ID = API_HOST + '/report/imagegroup/info/:id'

/**
 * 详情
 * @param {string|number} id Url参数id
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function getImagegroupInfoId(id, data, options) {
  return ajax({
    method: 'get',
    params: {
      id
    },
    data: data,
    url: GET_IMAGEGROUP_INFO_ID,
    ...options
  })
}

/**
 * 分页查询
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/imagegroup/list'
 */
export const POST_IMAGEGROUP_LIST = API_HOST + '/report/imagegroup/list'

/**
 * 分页查询
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function postImagegroupList(data, options) {
  return ajax({
    method: 'post',
    data: data,
    url: POST_IMAGEGROUP_LIST,
    ...options
  })
}

/**
 * 不分页查询
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/imagegroup/listAll'
 */
export const POST_IMAGEGROUP_LIST_ALL = API_HOST + '/report/imagegroup/listAll'

/**
 * 不分页查询
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function postImagegroupListAll(data, options) {
  return ajax({
    method: 'post',
    data: data,
    url: POST_IMAGEGROUP_LIST_ALL,
    ...options
  })
}

/**
 * 不分页查询-只能查自己的
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/imagegroup/listUserAll'
 */
export const POST_IMAGEGROUP_LIST_USER_ALL = API_HOST + '/report/imagegroup/listUserAll'

/**
 * 不分页查询-只能查自己的
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function postImagegroupListUserAll(data, options) {
  return ajax({
    method: 'post',
    data: data,
    url: POST_IMAGEGROUP_LIST_USER_ALL,
    ...options
  })
}

/**
 * 新增
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/imagegroup/save'
 */
export const POST_IMAGEGROUP_SAVE = API_HOST + '/report/imagegroup/save'

/**
 * 新增
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function postImagegroupSave(data, options) {
  return ajax({
    method: 'post',
    data: data,
    url: POST_IMAGEGROUP_SAVE,
    ...options
  })
}

/**
 * 修改
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/imagegroup/update'
 */
export const POST_IMAGEGROUP_UPDATE = API_HOST + '/report/imagegroup/update'

/**
 * 修改
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function postImagegroupUpdate(data, options) {
  return ajax({
    method: 'post',
    data: data,
    url: POST_IMAGEGROUP_UPDATE,
    ...options
  })
}
